<?php
$template = 1;
	if($template == 1){ // ORIGINAL
		$menu_output = '
		<!--[if lte IE 7]>
		<style type="text/css">
		.pro_linedrop {
		margin-top: -10px;
		}
		</style>
		
		<![endif]-->
		';
		
		$menu_output .= '
		  
		<div class="pro_linedrop">
		<ul class="select">
		';
		
		
	$results = $mysqli->menu_list();
      	for($x=0; $x < sizeof($results); $x++) {

			$current_menu_id 	= $results[$x]["menu_id"];
			$current_menu_name	= $results[$x]["menu_name"];
			$current_menu_active= $results[$x]["menu_active"];
					
					
		
			$menu_links = $mysqli->menu_link_list($current_menu_id);
 			
					if(sizeof($menu_links) == 1){
					$y=0;
						$menu_id 	= $menu_links[$y]["menulink_id"];
						$menu_name	= $menu_links[$y]["menulink_link_name"];
						$menu_url	= $menu_links[$y]["menulink_link_url"];
						$menu_target = $menu_links[$y]["menulink_link_url"];
								
								$menu_output .= '<li><a href="'.$menu_url.' '.$menu_target.'"><b>'.$menu_name.'</b></a></li> ';
							}
							else
							{ $menu_output .= ' <li class="line"><a href="/landing.php?id='.$current_menu_id.'"><b>'.$current_menu_name.'</b><!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"> '; 
							
		
							for($y=0; $y < sizeof($menu_links); $y++) {
								$menu_id 	= $menu_links[$y]["menulink_id"];
								$menu_name	= $menu_links[$y]["menulink_link_name"];
								$menu_url	= $menu_links[$y]["menulink_link_url"];
								$menu_target = $menu_links[$y]["menulink_link_url"];
								
								$menu_output .= '<li><a href="'.$menu_url.' '.$menu_target.'">'.$menu_name.'</a></li> ';
								 } 
								
								$menu_output .= '</ul> 
		<!--[if lte IE 6]></td></tr></table></a><![endif]--> 
		</li>  ';
			
					 
					 } 
					 
				}
		
		$menu_output .= '<?php
		
				if ($header_logged_in != 1){ ?>
				
				<li><a href="/login.php"><b>Login</b></a></a></li>
		 <?php }else{ ?> ";';
		
		$menu_output .= ' <li class="lrt"><a href="logout.php"><b>Logout</b></a></li> <?php } ?> ';
		
		
		
		
		
		//if admin, coach, manager, shows admin options
		
				$menu_output .= '
				<?php if($z_user_admin == "t"){ ?>';
				
		$menu_output .= ' <li class="lrt"><a href="'.$site_url.'/admin/"><b>ADMIN</b></a></li> <?php } ?> ';
		
		
		
		
		$menu_output .= '
		</ul>
		</div>
		</form>';
	}//END ORIGNAL TEMPLATE
	
	
	
$file = "../includes/current_menu.php";
$handle = fopen($file, "w");
fwrite($handle, $menu_output);
fclose($handle);	

?>